const mongoose = require("mongoose");
let db = mongoose.createConnection(
  "mongodb://localhost:27017/TechCodeKnowledgeStructure",
  {
    useNewUrlParser: true,
    useUnifiedTopology: true,
  },
  (err) => {
    if (err) {
      console.log("===============================");
      console.log("数据库连接失败:", err);
      console.log("===============================");
      return;
    }
    console.log("数据库连接成功");
  }
);

module.exports = {
  db,
  mongoose,
};
